<?php

/*
 * Treasure $5
 * 
 * $3
 * 
 * When you gain this, gain two Coppers
 * 
 */

class Cache extends Card implements iTreasure, iKingdom, iHinterlands {

    public function __construct() {
        parent::__construct("Cache", 5);
        $this->value = new Price(3);
    }

    public function getDescription() {
        return array(
            "worth $3",
            "When you gain this, gain two Coppers");
    }

    public function autoPlayNum(Game $game) {
        return 5;
    }

    public function gainThisCard(Game $game, $name = null) {
        $cards = array();
        $c1 = $game->moveCardFromPileToPile("Copper", BoardCards, DiscardPile, $name);
        $c2 = $game->moveCardFromPileToPile("Copper", BoardCards, DiscardPile, $name);
        if ($c1)
            $cards[] = $c1;
        if ($c2)
            $cards[] = $c2;

        ScreenDisplay::addScreenMessage($game, true, "gain " . nicePrint($cards), "gains " . ScreenDisplay::$LMSG, $name);
        
        $game->setTempCard($this);
        return true;
    }

}

?>